home *** CD-ROM | disk | FTP | other *** search
- Path: news.primenet.com!not-for-mail
- From: bking@primenet.com (Brien King)
- Newsgroups: comp.lang.c++,comp.lang.pascal.delphi.misc
- Subject: Re: Calling all API experts !!
- Date: 19 Mar 1996 23:28:02 -0700
- Organization: Primenet Services for the Internet
- Sender: root@primenet.com
- Message-ID: <314fa69d.8181856@news>
- References: <DoIMG1.F9y@unx.sas.com>
- X-Posted-By: ip098.phx.primenet.com
- X-Newsreader: Forte Agent .99d/32.182
-
- On Tue, 19 Mar 1996 12:52:49 GMT, sdkkah@mvs.sas.com wrote:
-
- >
- >Hi, world
- >
- >I am trying to make an application with a tool which just recently allowed
- >calling Windows API's. The tool (The SAS System) itself is written in C++.
- >Some API's works OK, but there's one I cant figure out how to use right.
- >Its called GetProfileString. I need to access the [fonts] section of WIN.INI,
- >and get all entries and values. But I dont know the number of entries to
- >read, since this obviously varies. Is there some kind of trick that would
- >allow me to loop through untill the last entry is read, without having to
- >know the exact number of entries in each section ?
- >
- >Getting the font names is just getting me half the way. I also need to
- >know the point size and property (Bold,Italic etc..). Does anyone know
- >where I can get this information ?
- >
- >Finally, can anyone recommend any good documentations as to how
- >Windows API's are dealt with in general ?
- >
- >All kind of help is appreciated.
- >
- You can skip the API when it comes to reading INI files. Use the
- TIniFile object, it has a method called "ReadSection", this will read
- all keys into a TStringList then you can loop through each element in
- the list and read the values associated with the key with the
- ReadString method of the TIniFile. Once you have built the list of
- fonts, you can use the API function GetTextMetrics which will return a
- lot of (if not all) the information you need.
-
-
-